<template>
	<view>
		<!--  -->
		<view class="margin">
			<block v-if="messageList.length">
				<!-- 设置滚动 -->
				<u-swipe-action autoClose>
					<block v-for="(val, i) in messageList" :key="i">
						<u-swipe-action-item :options="options1" @click='deleteItem(val, i)'>
				
				
							<view class="item1   u-border-bottom ">
								<view class="py-10 flexflex">
									<view class="mr-10 ">
										<u-avatar :src="val.uheadPic"></u-avatar>
									</view>
									<view class="" style="width: 100%;" @click="tzck(val.applyStatus, val)">
										<u-row :gutter='5'>
											<u-col span="3">
												<view class="demo-layout bg-purple-light">
													<view class="size_16 font_b">{{ val.uname }}</view>
												</view>
											</u-col>
											<u-col span="6">
												<view class="demo-layout bg-purple">
													<view class="size_14">{{ val.utechp }}</view>
												</view>
											</u-col>
											<u-col span="3">
												<view class="demo-layout bg-purple-light">
													<view class="size_14  uni-text-gray" v-if="val.applyStatus == '0'">
														{{ '待接诊' }}
													</view>
													<view class="size_14  text-blue" v-if="val.applyStatus == '1'">
														{{ '问诊中' }}
													</view>
													<view class="size_14 text-yellow" v-if="val.applyStatus == '3'">
														{{ '已完成' }}
													</view>
												</view>
											</u-col>
										</u-row>
										<u-row class="mt8 ms10  ">
											<u-col span="8">
												<view class="demo-layout bg-purple-light">
													<view class="size_14 ">{{ val.ucompname }}</view>
												</view>
											</u-col>
											<u-col span="4">
												<view class="demo-layout bg-purple">
													<view class="size_14">{{ val.udepartmentname }}</view>
												</view>
											</u-col>
										</u-row>
										<u-row>
											<u-col>
												<view class="demo-layout bg-purple mb-10 ">
				
												</view>
											</u-col>
										</u-row>
				
									</view>
								</view>
							</view>
				
				
						</u-swipe-action-item>
					</block>
				</u-swipe-action>
			</block>
			<u-empty v-else mode="data">
			</u-empty>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				messageList: [],
				options1: [{
					text: "删除",
					style: {
						backgroundColor: '#f56c6c'
					}
				}]
			}
		},
		methods: {
			goHandel(val) {
				/* 自定义跳转 */
			},
			/*  */
			async myAskMedical() {
				let re = await this.$API.messageApi.myAskMedical()
				this.messageList = re
				console.log(this.messageList, "messageList");
			},
			async del(id) {
				let re = await this.$API.orderApi.myorderDelete(id)
			},
			/*  */
			deleteItem(v, i) {
				console.log(v, "v");
				this.messageList.splice(i, 1)
				this.del(v.orderNo)
			},
			/*  */
			tzck(applyStatus, item) {
				console.log(item, 'item');

				this.$pub.go(
					`/pages_my/myConsultationDetail/myConsultationDetail?data=${encodeURIComponent(JSON.stringify(item))}`
					)
				// this.$pub.go('/pages_message/chathos/chathos?data=' + encodeURIComponent(JSON.stringify(item)))
			}
			/*  */
		},
		onShow() {
			this.myAskMedical()
		},
	}
</script>

<style lang="scss" scoped></style>